//  stty -F /dev/ttyUSB0 hupcl //Need to set the DTR signal low
//  Flashing:  avrdude -v -pm1280 -cstk500v1 -P/dev/ttyUSB0 -b57600 -D -Uflash:w:blink.hex:i
//  Alternatively, run make upload

#include <avr/io.h>
#include <util/delay.h>

 
//  The multiplyer for the delay cycles.  Decreasing will increase the speed the LED blinks.
#define CNT_MAX 100

int main (void)
{
	unsigned char counter;
	/* set PORTB for output*/
	DDRB = 0xFF; 
	/*  Set PORTB to a known state */
	PORTB = 0x00;
	
	while (1)
    {
		/*  toggle PORTB pin 7  */
    	PORTB ^= 0x80;		
 
      	/* wait (CNT_MAX * 120000) cycles */
      	counter = 0;
      	while (counter != CNT_MAX)
		{
	  		/* wait (30000 x 4) cycles = wait 120000 cycles */
	  		_delay_loop_2(30000);
	  		counter++;
		}
	}
 
	return 1; // Its typically NOT good to leave the main loop.
}
